#include"stdio.h"
#include<stdlib.h>
void main(){
    FILE * fp;
    char ch;
    fp = fopen("text.tet","w");
    if(fp==NULL){
        printf("创建文件错误。\n");
        exit(0);
    }
    printf("请输入一个字符串(回车键结束)\n");
    while((ch=getchar())!='\n'){
        fputc(ch,fp);
    }
    fclose(fp);
}